setup Window
Set up the given window at the given size and location or centered on the given parent, if provided. This will ensure that the window is centered on the parent, the display with the given coordinates, or the default/main display if none of those apply. It will also ensure that the window is not shown off-screen and not too large to fit on the selected display.
Parameters
the window to size and place appropriately
the width of the window, or zero to use the window's preferredSize.width
the height of the window, or zero to use the windows preferredSize.height
the x coordinate for the window or zero to use a sensible positioning algorithm
the y coordinate for the window or zero to use a sensible positioning algorithm
the parent component which is used to position the child window sensibly